﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page session="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Login</title>
	<link rel="shortcut icon" href="${pageContext.request.contextPath}/assets/images/favicon.ico" />
	<style type="text/css">
		@import "${pageContext.request.contextPath}/assets/style/global.css";
		@import "${pageContext.request.contextPath}/assets/style/login.css";
    </style>
    <script src="${pageContext.request.contextPath}/assets/kanas/kanas-base.js" ></script>
	<script src="${pageContext.request.contextPath}/assets/appscript/dojoconfigbaseurl.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/assets/appscript/dojoconfig.js" type="text/javascript"></script>
	<script type="text/javascript" language="javascript">
	//<![CDATA[
		dojoConfig.locale=$k.getLang();
		function changeLanguage(select){
			var locale=select.options[select.selectedIndex].value;
			if(locale&&locale!=""){
				var url = location.href;
				if(url.indexOf("?"))
					url = url.substring(0,url.indexOf("?"));
				url += "?" + $k.langKey + "=" + locale;
				window.location = url;
			}
		}
	//]]>
    </script>
	<script src="${pageContext.request.contextPath}/assets/dojo/dojo/dojo.js" data-dojo-config="parseOnLoad: false,async:true,isDebug: false"></script>
	<script>
	//<![CDATA[
		require(["dojo/ready","dojo/i18n!appscript/locale/nls/_Application","dojo/dom","dojo/query","dojo/_base/kernel","dojo/_base/loader"],
			function(ready,i18nApp,dom,query){
				ready(function(){
					document.title=i18nApp.htmlTitle;
					dom.byId("title").innerHTML=i18nApp.title;
					dom.byId("lbl_username").innerHTML=i18nApp.username;
					dom.byId("lbl_password").innerHTML=i18nApp.password;
					dom.byId("keep_my_token").innerHTML=i18nApp.keepMyToken;
					var div = dom.byId("message");
					if(div&&i18nApp[div.innerHTML])div.innerHTML=i18nApp[div.innerHTML];
					dom.byId("btn_signin").innerHTML=i18nApp.signIn;
					dom.byId("footer").innerHTML=i18nApp.copyright;
					query("#selectLang option").forEach(function(node, index, arr){
						if(node.value==dojoConfig.locale)node.selected = true;
					});
				});
		});
	//]]>
	</script>
</head>

<body>
<div id="header">
	<div class="content">
		<div id="langPane"><span>
			<select id="selectLang" onchange="changeLanguage(this)" >
				<option value="">Select Language</option>
				<option value="en-US">English (US)</option>
				<option value="zh-CN">简体中文</option>
			</select>
		</span></div>
		<div id="logo"></div>
	</div>
</div>
<div class="wrapper">
	<div class="content">
		<div id="login">
			<div id="title">Welcome to Kanas Administration</div>
			<form method="post" action="${pageContext.request.contextPath}/j_spring_security_check">
				<div><label id="lbl_username">username</label>
					<span><input type="text" name="j_username" id="username" class="textbox" /></span>
				</div>
				<div><label id="lbl_password">password</label>
					<span><input type="password" name="j_password" id="password" class="textbox" /></span>
				</div>
				<div>
					<label></label>
					<span><input type="checkbox" name="_spring_security_remember_me" /></span>
					<span id="keep_my_token">save my information</span>
				</div>
				<c:if test="${status=='authfailed'}" >
					<div><span id="message">${exception}</span>
					</div>
				</c:if>
				<div class="buttons"><button type="submit" name="submit" id="btn_signin" >Log in</button>
				</div>
			</form>
		</div>
	</div>
</div>
<div id="footer">
</div>
</body>
</html>